import 'package:flutter/material.dart';

class Miscdiget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Invoke "debug painting" (press "p" in the console, choose the
          // "Toggle Debug Paint" action from the Flutter Inspector in Android
          // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
          // to see the wireframe for each widget.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          //mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget> [
            FlatButton.icon(
              icon: Icon(Icons.send),
              label: Text('打开一个新页面'),
              textColor: Colors.blue,
              onPressed: () {
                //Navigator.push(
                //  context, MaterialPageRoute(builder: (context) {
                //    return SecondPage();
                //  })
                //);
                Navigator.pushNamed(context, "second_page");
              },
              ),
              RaisedButton(
                child: Text('传值route测试'),
                textColor: Colors.blue,
                onPressed: () {
                  //var result = Navigator.push(context, MaterialPageRoute(
                  //  builder: (context) {
                  //    return TipsPage(
                  //      text: '我是小白'
                  //    );
                  //  }
                  //)); 
                  var result = Navigator.pushNamed(context, "third_page", arguments: "我是传递参数");
                  print("路由返回值: $result");
                },
              ),
              OutlineButton(
                child: Text('随机单词界面'),
                textColor: Colors.blue,
                onPressed: () => Navigator.pushNamed(context, "word_page")
              ),
              IconButton(
                icon: Icon(Icons.thumb_up),
                onPressed: () => Navigator.pushNamed(context, "tapbox_a")
              ),
              FlatButton(
                color: Colors.blue,
                highlightColor: Colors.blue[700],
                colorBrightness: Brightness.dark,
                splashColor: Colors.grey,
                child: Text('确定'),
                shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
                onPressed: () => Navigator.pushNamed(context, "tapbox_a")
              )
              
          ],
        ),
      ),
    );
  }
  
}